package com.example.admin.yuejian21.Adapter;

import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.admin.yuejian21.Bean.Club;
import com.example.admin.yuejian21.Bean.comment;
import com.example.admin.yuejian21.R;
import com.example.admin.yuejian21.ViewHolder.CommentViewholder;
import com.example.admin.yuejian21.ViewHolder.renqiViewHolder;
import com.example.admin.yuejian21.activity.ClubDetailActivity;

import org.w3c.dom.Comment;

import java.util.ArrayList;
import java.util.List;

import it.sephiroth.android.library.picasso.Picasso;

/**
 * Created by Admin on 2017/11/6.
 */

public class CommentAdapter extends RecyclerView.Adapter {
    private List<comment> CommentList =new ArrayList<>();

    private Context context;
    private LayoutInflater layoutInflater;
    public  static String replyuserid;
    public  static String shaituid;
    public CommentAdapter(Context context,List<comment> Commentlist ) {
        this.context = context;
        layoutInflater = LayoutInflater.from(context);
        this.CommentList.addAll(Commentlist);
    }
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View itemView =
                layoutInflater.inflate(R.layout.item_comment,parent,false);

        CommentViewholder holder =
                new CommentViewholder(itemView);

        return holder;

    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        CommentViewholder commentViewHolder =
                (CommentViewholder) holder;
        final comment comment = CommentList.get(position);

        String username =comment.getUser_name();
        String replyname =comment.getReply();





        commentViewHolder.usernameView.setText(username);
        commentViewHolder.replyView.setText(replyname);








                replyuserid = comment.getReply_userid();
               shaituid=comment.getShaitu_id();

    }

    @Override
    public int getItemCount() {
        return CommentList.size();
    }
}
